﻿function Explocion(juego, x, y) {
    Objeto.call(this, juego, x, y);
    this.animation = new Animacion(MANEJADOR_RECURSOS.getAsset('img/explosion.png'), 32, 0.12);
    this.radius = this.animation.frameWidth / 2;
}
Explocion.prototype = new Objeto();
Explocion.prototype.constructor = Explocion;

Explocion.prototype.update = function () {
    Objeto.prototype.update.call(this);
    if (this.animation.isDone()) {
        this.removeFromWorld = true;
    }
}

Explocion.prototype.draw = function (ctx) {
    Objeto.prototype.draw.call(this, ctx);
    this.animation.drawFrame(this.juego.clockTick, ctx, (this.x * this.juego.tileSize) + this.juego.tileSize / 2, (this.y * this.juego.tileSize) + this.juego.tileSize / 2);
}
